package com.zzw.basic.io;

import java.io.StringReader;
import java.io.StringWriter;

public class StringNodeTest {

	public static void main(String[] args) {
		String src = "��������\n"
				+ "���������ǵط� \n"
				+ "�����Ȥζ\n";
		
		char[] buffer = new char[32];
		int hasRead = 0;
		try {
			StringReader sr = new StringReader(src);
			while((hasRead = sr.read(buffer)) != -1){
				System.out.println(new String(buffer,0,hasRead));
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		try {
			StringWriter sw = new StringWriter();
			sw.write("������������qweq\n");
			sw.write("������������adasd\n");
			sw.write("������������ada\n");
			System.out.println(sw.toString());
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}

}
